var result = [];

let mapStatus = getLocalValue("mapStatus");

console.log("mapStatus");
// 需要传入该参数，脚本内部不能访问 window对象；
// var d = window.devicePixelRatio;


var zoom = data.zoom
var currentCenterLng = data.lng
var currentCenterLat = data.lat
var width = 2880;
var height = 1232;


// var extent = [117.40817, 30.75411, 122.253141, 35.472302];
// var extent = [minXY.x, minXY.y, maxXY.x, maxXY.y];

//根据范围 进行poi搜索

// console.log(extent);

// function randomNumBoth(Min, Max) {
//   // Math.floor(Math.random() * (Max - Min) + Min);
//   return Math.random() * (Max - Min) + Min
// }

// var length = 100;
// for (var i = 0; i < length; i++) {
//   result.push({
//     "name": "测试" + i,
//     "resourceMainClassName": 0,
//     "resourceSubClassName": 0,
//     "resourceBasicTypeName": 0,
//     "lng": randomNumBoth(extent[0], extent[2]),
//     "lat": randomNumBoth(extent[1], extent[3]),
//     "value": 1,
//     "info": "测试" + i,
//     // "iconUrl": "https://datav.oss-cn-hangzhou.aliyuncs.com/uploads/images/9975d04ddb46423a8d7978a786bfa88a.png"
//   })
// }
// console.log("对图标处理");
// console.log(result);

if (mapStatus.AvoidLayer_pointSim) {
  // result = mapStatus.AvoidLayer_pointSim.getPointsByCenter(currentCenterLng, currentCenterLat, zoom, width, height);
  result = mapStatus.AvoidLayer_pointSim.getClusterPointsByCenter(currentCenterLng, currentCenterLat, zoom, width, height, 5, 2);

  console.log(result);
} else {
  result = [];
}

for (var i = 0; i < result.length; i++) {
  result[i].info = result[i].name;
}


// let mapStatus = getLocalValue("mapStatus");
console.log("对图标处理00", result);
console.log(mapStatus);
// console.log(mapStatus.Test0LayerData);

return result;